from django.contrib.auth.mixins import LoginRequiredMixin
from django import http
from shop.utils.response_code import RETCODE

class LoginRequiredJson(LoginRequiredMixin):
    def handle_no_permission(self):
        #响应Json
        return http.JsonResponse({
            'code': RETCODE.SESSIONERR,
            'errmsg': '用户未登录'
        })